url = 'https://www.acwing.com/problem/content/799/'

n,m = map(int,input().split())

data = list(map(int,input().split()))

b = [0] * (100100)

def insert(l,r,c):
    b[l] += c
    b[r + 1] -= c

for i in range(len(data)):
    insert(i+1, i+1, data[i])

for i in range(m):
    l,r,c = map(int,input().split())
    insert(l, r, c)


for i in range(len(b)):
    b[i] += b[i - 1]

print(*b[1:n+1])
    
    
    